<link rel="stylesheet" type="text/css" href="{{ URL::asset('public_css/base.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ URL::asset('fenhome/newdingyue.css') }}" />

<div class="j_dingTitle">
    <!--<p><img src="{{ URL::asset('fenhome/image/ren.png') }}" alt="">订阅者</p>-->
    <span class="active">订阅会员{{count($dingYueZhong)}}人</span>
    <span>会员过期{{count($guoQi)}}人</span>
    <span>试用客户{{count($shiYong)}}人</span>
</div>
<div class="divtab" id="dealPerson">
    <div class="merchandiser">
        @if($dingYueZhong)
        @foreach($dingYueZhong as $key=>$val)
            @if($key%4 == 0)
        <ul class="clearfix">
            @endif
            <li @if($key%4 == 1) style="margin:0 20px;" @endif>
                <div>
                    <i></i>
                    <img src="{{$val->photo ? $val->photo : URL::asset('ucenter/images/head.png')}}" alt="">
                </div>
                <p class="jname">{{ $val->allnum ? round($val->allnum,2) :0}}</p>
                <p class="jzx">订阅获利</p>
                <a href="javascript:;">
                    <span class="jli">{{$val->follow_name}}</span>
                    <span class="jdian">
                        @if($val->follow_time != '')
                        {{ date('Y-m-d',$val->follow_time) }}
                        @endif</span>
                </a>
                <a href="javascript:;" class="j_color">
                    <span class="jli">{{$val->direction == 0 ? '正向':'反向'}}订阅</span>
                    <span class="jdian">
                                跟随时间
                        
                    </span>
                </a>
            </li>
            @if($key%4 == 3 && $key > 0)
        </ul>      
            @endif
        @endforeach
        @endif


    </div>
    <div class="merchandiser">
        @if($guoQi)
        @foreach($guoQi as $key=>$val)
        @if($key%4 == 0)
        <ul class="clearfix">
            @endif
            <li @if($key%4 == 1) style="margin:0 20px;" @endif>
                <div>
                    <i class="j_guoqi"></i>
                   <img src="{{$val->photo ? $val->photo : URL::asset('ucenter/images/head.png')}}" alt="">
                </div>
                <p class="jname">{{ $val->allnum ? round($val->allnum,2) :0}}</p>
                <p class="jzx">订阅获利</p>
                <a href="javascript:;">
                    <span class="jli">{{$val->follow_name}}</span>
                    <span class="jdian">
                        @if($val->follow_time != '')
                        {{ date('Y-m-d',$val->follow_time) }}
                        @endif</span>
                </a>
                <a href="javascript:;" class="j_color">
                    <span class="jli">{{$val->direction == 0 ? '正向':'反向'}}订阅</span>
                    <span class="jdian">跟随时间</span>
                </a>
            </li>
            @if($key%4 == 3 && $key > 0)
        </ul>
        @endif
        @endforeach
        @endif

    </div>
    <div class="merchandiser">
        @if($shiYong)
        @foreach($shiYong as $key=>$val)
        @if($key%4 == 0)
        <ul class="clearfix">
            @endif
            <li @if($key%4 == 1) style="margin:0 20px;" @endif>
                <div>
                    <i class="j_shiyong"></i>
                    <img src="{{$val->photo ? $val->photo : URL::asset('ucenter/images/head.png')}}" alt="">
                </div>
                <p class="jname">{{ $val->allnum ? round($val->allnum,2) :0}}</p>
                <p class="jzx">订阅获利</p>
                <a href="javascript:;">
                    <span class="jli">{{$val->follow_name}}</span>
                    <span class="jdian">
                            
                        @if($val->follow_time != '')
                        {{ date('Y-m-d',$val->follow_time) }}
                        @endif</span>
                </a>
                <a href="javascript:;" class="j_color">
                    <span class="jli">{{$val->direction == 0 ? '正向':'反向'}}订阅</span>
                    <span class="jdian">
                                跟随时间
                        
                    </span>
                </a>
            </li>
            @if($key%4 == 3 && $key > 0)
        </ul>
        @endif
        @endforeach
        @endif


    </div>
    
    @if($totalpage && $totalpage != 0)
        <div class="jpage">
            <div class="jpage_div1" id="pagefollow" style="font-size:14px;">
                @if($page != 1 && $page != 0)   {{$uid}},{{$page}}
                    <a href="javascript:void(0)" onclick='gotopage(0)'  target="iframeMain" style="background-color:#3b9ce0">上一页</a>
                @else
                    <a href="javascript:void(0)"target="iframeMain" style="background-color:#c2c4c9">上一页</a>
                @endif
                <div>
                    <span>第<span style="color:#3b9ce0"></span>页</span>
                </div>
                @if($page != $totalpage && $page<$totalpage)
                    <a href="javascript:void(0)"  onclick='gotopage(1)' target="iframeMain" style="background-color:#3b9ce0">下一页</a>
                @else
                    <a href="javascript:void(0)" target="iframeMain" style="background-color:#c2c4c9">下一页</a>
            @endif
             <div>共条记录</div> 
                <div>共  页</div>
                {{ $totalpage }}
            </div>
        </div>
    @endif
</div>
<script type="text/javascript" src="{{ URL::asset('public_js/jquery-1.8.3.min.js') }}"></script>
<script>
    function gotopage(uid,page,type){
        if(type == 0) {
            var url = "?analyst_id="+uid+"&page="+(page-1)+"&type="+type;
        }else{
            var url = "?analyst_id="+uid+"&page="+(page+1)+"&type="+type;
        }
        url = '{{url("/followerlist")}}'+url;

        $(window.parent.document).find("#iframeMain").attr("src",url);
    }
    $('.j_dingTitle > span').click(function(){
        $(this).addClass('active').siblings('span').removeClass('active');
        $('.merchandiser').eq($(this).index()).show().siblings('.merchandiser').hide();
    })
</script>
